﻿/* AAM Navigation Hover Effect Javascript */

$(document).ready(function () {
    // Initiate animation values
    slide("#sliding-nav", 36, 18, 150);

});


// Navigation
// Pad out - Amount of menu element's right movement (35)
// Pad in - " " " " left movement (18)
// Duration - Time taken for menu element on-hover effect (150)

function slide(navigation_id, pad_out, pad_in, duration) {
    // Initiates the target paths
    var list_elements = navigation_id + " li.sliding-element";

    var link_elements = list_elements + " a";


    // Hover-slide effect for all menu elements
    $(link_elements).each(function (i) {
        $(this).hover(
		function () {
		    $(this).animate({ paddingLeft: pad_out }, duration);
		},
		function () {
		    $(this).animate({ paddingLeft: pad_in }, duration);
		});
    });
}